package com.java.concurrency;

import java.sql.Connection;
import java.util.concurrent.Callable;

import com.java.concurrency.db.DBConnection;
/**
 * this is actual thread executes.
 * @author managanesh
 *
 */
public class QueryExecutor implements Callable<QueryResult>{
	
	private Query query;
	
	public QueryExecutor(Query query) {
		super();
		this.query = query;
	}
	public QueryResult call() throws Exception{
		QueryResult result = new QueryResult();
		
		System.out.println("Executing query"+query.getQuery());
		Connection con=DBConnection.getConnection();
		
		//write rest of the code to use Query object to fire the query
		System.out.println("Completed Executing query"+query.getQuery());
		return result;
	}

	
}
